package cn.wolfcode.shop.vo;

import java.io.Serializable;

public class JsonResultVO implements Serializable{

    private boolean success = true;

    private String errorMsg;

    private Object result;

    public boolean isSuccess() {
        return success;
    }


    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.success = false;
        this.errorMsg = errorMsg;
    }

    public static JsonResultVO success() {
        return new JsonResultVO();
    }
    public static JsonResultVO success(Object obj) {
        JsonResultVO jsonResultVO = new JsonResultVO();
        jsonResultVO.setResult(obj);
        return jsonResultVO;
    }

    public static JsonResultVO error(String msg) {
        JsonResultVO jsonResultVO = new JsonResultVO();
        jsonResultVO.setErrorMsg(msg);
        return jsonResultVO ;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }
}
